import { Button, VerticalBox, LineEdit } from "std-widgets.slint";
export global Buttons{
    callback buttons_pressed(string);
}
component MyButton inherits Button {
    in-out property <string> name;
    clicked => {
        Buttons.buttons_pressed(self.name);
    }
}

export component App inherits Window {
    in-out property <string> shutdownBtnStatus;
    in-out property <string> input : "请在此输入“打卡完成”";

    width: 400px;
    height: 300px;
    title: "ClockinReminder";
    icon: @image-url("shutdown.png");
    VerticalBox{
        Text {
            text: shutdownBtnStatus;
            vertical-alignment: center;
            horizontal-alignment: center;
        }
        MyButton {
            name:"switch";
            text:"切换";
        }
        LineEdit {
            text: input;
            edited => {
                input = self.text;
            }
            horizontal-alignment: center;
        }
        MyButton {
            name:"shutdown";
            text: "关机";
        }   
        Text {
            height: 10px;
            text: "By 杨嘉波 30065792";
            vertical-alignment: center;
            horizontal-alignment: center;
        }
    }
}